const Koa = require('koa');
const router = require('./router');
const cors = require('koa-cors');
const bodyparser = require('koa-bodyparser');
const app = new Koa();
const Model = require('./Model'); //{ products: products, users: users, sync: [AsyncFunction (anonymous)] }

app.use(cors());
app.use(bodyparser());
app.use(router());


(async() => {
    await Model.sequelize_sync();
})();

app.listen(8000, () => {
    console.log('http://localhost:8000');
});